<?php 
//引进配置信息
include '../include/init.php';
//引入数据库配置信息
include '../include/mysql.config.php';
//引入公共函数
include '../include/common.fun.php';	
islogin();
include '../data/admin_data.php';

if($_POST){
	$idarr = isset($_POST['idarr'])?$_POST['idarr']:0;
	$ids = implode(',',$idarr);
	$where = "admin_id IN ($ids)";
	$res = $db->delete('wd_admin',$where);
	if($res){
		alert('删除成功','admin_list.php');
	}else{
		alert('删除失败');
	}
}
$page = new Page($current,$count,$limit,5);
$current=isset($_GET['page'])?$_GET['page']:1;

$sql='SELECT COUNT(admin_id) as count from wd_admin';
$news_list=$db->getOne($sql);
$count=$news_list['count'];

$limit=5;
$start=($current-1)*$limit;

$page_link = $page->first()->prev()->num()->next()->show();



$sql="SELECT * from wd_admin order by admin_addtime desc limit $start,$limit";
$admin=$db->getAll($sql);



include 'view/admin_list.php';